package com.appkudos.model;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.appkudos.view.R;

public class AppKudosToast {
	public AppKudosToast(){
		
	}
	
	  public void CreateToast(LayoutInflater inflater, View layout, Context context, String text, int duration){		
		  ImageView image = (ImageView) layout.findViewById(R.id.toast_image);
		  image.setImageResource(R.drawable.ic_button_star);
		  TextView toast_text = (TextView) layout.findViewById(R.id.toast_text);
		  toast_text.setText(text);
		
		  Toast toast = new Toast(context);
		  toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
		  toast.setDuration(Toast.LENGTH_LONG);
		  toast.setView(layout);
		  toast.show();
	  }
	
}
